public class Main {
    public static void main(String[] args) {
        CalculatorForm calculatorForm=new CalculatorForm();
        AbstractCommand addCommand=new AddCommand();
        calculatorForm.setCommand(addCommand);
        calculatorForm.compute(10);
        System.out.println("+20");
        calculatorForm.compute(20);
        System.out.println("回滚");
        calculatorForm.undo();
    }
}